package org.nbict.iot.protocol.task;

import org.apache.storm.trident.operation.BaseFilter;
import org.apache.storm.trident.tuple.TridentTuple;

/**
 * Created by songseven on 18/6/25.
 */
public class DiseaseFilter extends BaseFilter {
    @Override
    public boolean isKeep(TridentTuple tuple) {

        DiagnosisEvent diagnosis = (DiagnosisEvent) tuple.getValue(0);
        Integer code = Integer.parseInt(diagnosis.diagnosisCode);
        if (code.intValue() <= 322) {
            return true;
        } else {
            return false;
        }
    }
}
